// Include files.
#include "StateDoneCode.hpp"
#include "AsyncStatusStartState.hpp"
#include "AsyncStatusFinishState.hpp"

/**
 *  Constructor for AsyncStatusFinishState.
 */
AsyncStatusFinishState::AsyncStatusFinishState(AsyncStatusStartState &startState) :
	m_startState(startState)
{
}

/**
 *  Destructor for AsyncStatusFinishState.
 */
AsyncStatusFinishState::~AsyncStatusFinishState()
{
}

void AsyncStatusFinishState::PeriodicImpl()
{
	if (m_startState.GetAsyncStatus().GetIsFinished())
		SetDoneCode(StateDoneCode::GetSuccessCode());
}
